package com.lhoverc.controller.user;

import com.lhoverc.annotation.Log;
import com.lhoverc.pojo.Result;
import com.lhoverc.pojo.entity.VisitorEntity;
import com.lhoverc.service.visitor.VisitorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: LiCheng
 * @CreateTime: 2025-04-14
 * @Description:
 * @Version: 1.0
 */
@Slf4j
@RestController
@RequestMapping("/user/visitor")
public class VisitorController {
    @Autowired
    private VisitorService visitorService;

    /**
     * 添加visitor
     * @param visitor
     * @return
     */
    @Log
    @PostMapping("/add")
    public Result addVisitor(@RequestBody VisitorEntity visitor) {
        visitorService.addVisitor(visitor);
        return Result.success();
    }
}
